x86: ioapic_write() must check for weird redir entries with special
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 13 Jun 2007 09:39:48 +0000 (10:39 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 13 Jun 2007 09:39:48 +0000 (10:39 +0100)
delivery mode yet apparently valid vectoring information.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/io_apic.c

index ebd177deb1e2481e2da9d6fb1342c45fd95e10b8..5aff60f52bcf7cf00106baeb6aded91622e116bf 100644 (file)
@@ -2114,6 +2114,15 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
         return 0;
     }
 
+    /* Special delivery modes (SMI,NMI,INIT,ExtInt) should have no vector.  */
+    if ( (old_rte.delivery_mode > dest_LowestPrio) && (old_rte.vector != 0) )
+    {
+        WARN_BOGUS_WRITE("Special delivery mode %d with non-zero vector "
+                         "%02x\n", old_rte.delivery_mode, old_rte.vector);
+        /* Nobble the vector here as it does not relate to a valid irq. */
+        old_rte.vector = 0;
+    }
+
     if ( old_rte.vector >= FIRST_DYNAMIC_VECTOR )
         old_irq = vector_irq[old_rte.vector];
     if ( new_rte.vector >= FIRST_DYNAMIC_VECTOR )